<template>
  <div>
    <el-menu router :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
      text-color="#4a5064" active-text-color="#00AC84">
      <el-menu-item id="img-item" index="1">
        <img id="img" src="../../assets/images/logo.jpg">
      </el-menu-item>
      <el-menu-item index="/home" @click="toNext('/home')">首页</el-menu-item>
      <el-menu-item index="/selectNewHouse"  @click="toNext('/selectNewHouse')">新房</el-menu-item>
      <el-menu-item index="/selecOldHouse">二手房</el-menu-item>
      <el-menu-item index="7">地图找房</el-menu-item>
      <el-menu-item v-if="loginname===''" index="/login" @click="toNext('/login')">登录/注册</el-menu-item>
      <el-menu-item v-if="loginname!==''" index="/myself" @click="toNext('/myself')">欢迎您!{{loginname}}</el-menu-item>
      <el-menu-item v-if="loginname!==''" index="/login" @click="loginOut('/login')">退出登陆 </el-menu-item>
    </el-menu>
  </div>
</template>
<script src="../js/header.js"></script>

<style scoped>
  #img-item {
    margin-left: 30px;
    margin-right: 10px;
  }

  #img {
    width: 85px;
    height: 60px;

  }

  .el-menu-item {
    color: #000000;
    font-size: 18px;
  }
</style>
